
<template>
  <div>
    <h3>欢迎光临vue水果店</h3>
    <p>苹果10元/斤  折扣8折</p>
    请输入你要购买的斤数:<input type="text" v-model="num"/><br/>
    <button @click="sum = num *10">结账买单</button>
    <p>结账单 总价 {{sum }}元  折扣价:{{sum*0.8}} 元 省了:{{sum - sum*0.8}}</p>
  </div>
</template>

<script>
export default {


  data() {
    return {
      num :0,
      sum: 0
    };
  },

};
</script>

<style lang="less" scoped>

</style>